{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
*}

<div class="infomessage" id="intro">
  There are no Google AdSense accounts linked to OpenX yet. We can sign you
  up for a new AdSense account or we can link your existing AdSense account to
  your OpenX installation. This allows you to manage Google AdSense in the
  same way as other advertisers and view your revenue statistics within the
  OpenX interface.
</div>

<div style="font-weight: bold; margin-bottom: 2ex">
  Do you already have a Google AdSense account?
</div>

<div style="margin-bottom: 4ex">
  <input id="haveaccount-yes" type="radio" name="haveaccount" value="yes" style="margin-left: 0"><label for="haveaccount-yes" class="cb" style="padding-right: 1em">Yes</label>
  <input id="haveaccount-no" type="radio" name="haveaccount" value="no"><label for="haveaccount-no" class="cb">No</label>
</div>

{include file=adsense-link.html fields=$fieldsLink hide="true"}

{include file=adsense-create.html fields=$fieldsCreate hide="true"}

<script>
{literal}
  $(document).ready(function() {
    var switchForm = function() {
      var selected = $("#haveaccount-yes").attr("checked") || $("#haveaccount-no").attr("checked") || false;
      var haveAccount = $("#haveaccount-yes").attr("checked") || !$("#haveaccount-no").attr("checked");

      if (!selected) {
        $("#intro").slideFadeIn(500);
        $("#adsense-link-form, #adsense-create-form").slideFadeOut(500);
      }
      else {
        $("#intro").slideFadeOut();
        if (haveAccount) {
          $("#adsense-create-form").slideFadeOut(500);
          $("#adsense-link-form").slideFadeIn(500);
        }
        else {
          $("#adsense-link-form").slideFadeOut(500);
          $("#adsense-create-form").slideFadeIn(500);
        }

        $(":input:visible:eq(0)").focus();
      }
    }

    $("#haveaccount-yes, #haveaccount-no").click(switchForm);
    switchForm();
  });
{/literal}
</script>

{*
</table>
*}
